Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    June 2013
    Posts
    2

    Unhappy Info panel showing images

    Dont think there is but someone might have a solution .
    Is there any way of getting images in the info panel, using img bbcodes in the ts3plugin_infoData function doesnt work .

    They wont load : Name:  3qIKJ.png
Views: 251
Size:  2.4 KB

    Had some big plans for a plugin but isnt really that awesome without images :P.

  2. #2
    Join Date
    June 2013
    Posts
    2
    Ok after some testing and alot of trial and error I managed to get Qt elements in the info panel.

    How to:

    Getting the main window pointer, source from CrossTalk
    Code:
    QWidget* GetMainWindow()
    {
    	// Get MainWindow
    	QList<QWidget*> candidates;
    	foreach (QWidget *widget, QApplication::topLevelWidgets()) {
    		if (widget->isWindow() && widget->inherits("QMainWindow") && !widget->windowTitle().isEmpty())
    			candidates.append(widget);
    	}
    
    	if (candidates.count() == 1)
    		return candidates.at(0);
    	else
    	{
    		printf("Couldnt find top window\n");
    		return NULL;
    	}
    }
    Searching for a Qt Obj (widget) by name

    Code:
    QObject *FindQtObjByName(QObject *root, char *name)
    {
    	const char* mName = root->objectName().toLocal8Bit().constData();
    	if (strcmp(name,mName) == 0)
    		return root;
    
    	QObjectList childr = root->children();
    	for(int i = 0; i < childr.size(); i++)
    	{
    		QObject *result = FindQtObjByName(childr[i],name);
    		if(result != 0)
    			return result;
    	}
    
    	return 0;
    }
    Adding a simple comboBox for testing

    Code:
    QObject *infoFrame = FindQtObjByName(GetMainWindow(), "InfoFrame");
    
    if(infoFrame)
    {
    	QWidget* widget = (QWidget*)infoFrame;
    	comboBox = new QComboBox(widget);
    	comboBox->setObjectName(QString::fromUtf8("comboBox"));
    	comboBox->setGeometry(QRect(130, 120, 69, 22));
    
    	comboBox->show();
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Client info panel is buggy on rename
    By Not Bob in forum Skins / Icon & Sound Packs
    Replies: 6
    Last Post: June 3rd, 2014, 02:26 PM
  2. Info Panel Nickname
    By Izamina in forum Client Support
    Replies: 3
    Last Post: September 27th, 2010, 08:09 AM
  3. Replies: 1
    Last Post: September 3rd, 2010, 07:58 AM
  4. Replies: 4
    Last Post: June 8th, 2010, 02:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •