本文整理汇总了C++中Tab::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:C++ Tab::setDisabled方法的具体用法?C++ Tab::setDisabled怎么用?C++ Tab::setDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::setDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
ClientGUI::ClientGUI(QWidget *parent)
: QWidget(parent)
{
/**********
* Initialize NULL pointer
**********/
client = NULL;
/**********
* Build base application window
**********/
setWindowTitle("GaoChat Client");
// Construct tabs
tabPt = new map<QString,Tab*>;
tabs = new CloseableTabWidget(tabPt);
tabs->setDocumentMode(true);
tabs->setTabPosition(QTabWidget::North);
tabs->setTabsClosable(true);
Tab *groupChat = new GroupTab(this);
groupChat->setDisabled(true); // Disable until connected to server
tabPt->insert(std::pair<QString,Tab*>(ROOTTAB,groupChat));
tabs->addTab(groupChat,"Group Chat");
QLayout *mainLayout = new QVBoxLayout;
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
mainLayout->addWidget(tabs);
setLayout(mainLayout);
/**********
* Dialog box prompting for server,port and nickname
**********/
configPrompt = new QDialog;
configPrompt->setWindowTitle("Settings");
configPrompt->setFixedSize(configPrompt->sizeHint());
configPrompt->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
QLayout *serverSettings = new QVBoxLayout;
serverAddr = new QLineEdit;
serverAddr->setFixedWidth(125);
serverAddr->setText("127.0.0.1");
serverPort = new QSpinBox;
serverPort->setMinimum(1024);
serverPort->setMaximum(65535);
serverPort->setValue(S_PORT);
// Radio buttons for UDP/TCP
serverSettings->addWidget(new QLabel("Server:"));
serverSettings->addWidget(serverAddr);
serverSettings->addWidget(new QLabel("Port:"));
serverSettings->addWidget(serverPort);
serverSettings->setSpacing(1);
serverSettings->setMargin(0);
QLayout *userSettings = new QVBoxLayout;
nick = new QLineEdit;
nick->setText("sudowork");
userSettings->addWidget(new QLabel("Nickname:"));
userSettings->addWidget(nick);
QPushButton *conn = new QPushButton("Connect");
connect(conn,SIGNAL(clicked()),this,SLOT(serverConnect()));
QPushButton *quit = new QPushButton("Quit");
connect(quit,SIGNAL(clicked()),this,SLOT(quit()));
QVBoxLayout *configLayout = new QVBoxLayout;
configLayout->addLayout(serverSettings);
configLayout->addLayout(userSettings);
configLayout->addWidget(conn);
configLayout->addWidget(quit);
configPrompt->setLayout(configLayout);
configPrompt->exec();
}